<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>班级平均分统计系统</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
        }
        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 2rem 0;
            margin-bottom: 2rem;
        }
        .form-container {
            background: white;
            border-radius: 15px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.1);
            padding: 2rem;
            margin-bottom: 2rem;
        }
        .class-input-group {
            margin-bottom: 1.5rem;
            padding: 1rem;
            border: 1px solid #e9ecef;
            border-radius: 8px;
            background-color: #f8f9fa;
        }
        .class-title {
            color: #495057;
            font-weight: 600;
            margin-bottom: 0.5rem;
        }
        .submit-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            padding: 0.75rem 2rem;
            font-size: 1.1rem;
            border-radius: 25px;
        }
        .submit-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        }
        .instructions {
            background-color: #e7f3ff;
            border-left: 4px solid #007bff;
            padding: 1rem;
            margin-bottom: 2rem;
            border-radius: 4px;
        }
    </style>
</head>
<body>
    <div class="header">
        <div class="container">
            <h1 class="text-center mb-0">
                <i class="fas fa-calculator me-2"></i>
                班级平均分统计系统
            </h1>
            <p class="text-center mb-0 mt-2">快速统计12个班级的考试成绩平均分</p>
        </div>
    </div>

    <div class="container">
        <div class="instructions">
            <h5><i class="fas fa-info-circle me-2"></i>使用说明</h5>
            <ul class="mb-0">
                <li>在每个班级的输入框中输入该班所有学生的成绩</li>
                <li>成绩之间用英文逗号分隔（例如：85,92,78,90,88）</li>
                <li>留空的班级将显示为0分</li>
                <li>点击"计算平均分"按钮查看结果</li>
            </ul>
        </div>

        <div class="form-container">
            <form action="/calculate" method="POST">
                <div class="row">
                    {% for i in range(1, 13) %}
                    <div class="col-md-6 col-lg-4">
                        <div class="class-input-group">
                            <label for="class_{{i}}" class="class-title">
                                <i class="fas fa-users me-2"></i>班级 {{i}}
                            </label>
                            <textarea 
                                class="form-control" 
                                id="class_{{i}}" 
                                name="class_{{i}}" 
                                rows="3" 
                                placeholder="请输入班级{{i}}的成绩，用逗号分隔&#10;例如：85,92,78,90,88"
                            ></textarea>
                        </div>
                    </div>
                    {% endfor %}
                </div>
                
                <div class="text-center mt-4">
                    <button type="submit" class="btn btn-primary submit-btn">
                        <i class="fas fa-calculator me-2"></i>
                        计算平均分
                    </button>
                </div>
            </form>
        </div>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js"></script>
</body>
</html>